import { ajax } from '../http.js';

const getProductUrl = '/authc/user_store/find_all';
const saveShopInfoUrl = '/authc/user_store/save';
const getStoreInfoUrl = '/authc/user_store/find_user_rank_store';
const changeShopUrl = '/authc/user_store/update';

const getProduct = (data, success, fail) => { // 获取经营品类
  ajax({
    url: getProductUrl,
    data: data,
    success: success,
    fail: fail
  });
};
const saveShopInfo = (data, success, fail) => { // 保存门店西信息
  ajax({
    url: saveShopInfoUrl,
    data: data,
    success: success,
    fail: fail
  });
};
const getStoreInfo = (data, success, fail) => { // 获取门店认证信息
  ajax({
    url: getStoreInfoUrl,
    data: data,
    success: success,
    fail: fail
  });
};

const changeShop = (data, success, fail) => { // 更新门店信息
  ajax({
    url: changeShopUrl,
    data: data,
    success: success,
    fail: fail
  });
};

export {
  getProduct,
  saveShopInfo,
  getStoreInfo,
  changeShop
}